﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessLogicLayer;
using DataAccessLayer;

namespace ChamCong.Admin
{
    public partial class ReportNhanVien : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void LoadReport(string _hoten, int _mapb)
        {
            var source =
                new Microsoft.
                Reporting.
                WebForms.
                ReportDataSource("NhanViends", new NhanVienBLL().DSNhanVien(_mapb, _hoten, 1));
            repv.LocalReport.ReportPath = "Report/BangNhanVienReport.rdlc";
            repv.LocalReport.DataSources.Clear();
            repv.LocalReport.DataSources.Add(source);
            repv.LocalReport.Refresh();
        }

        protected void btnXem_Click(object sender, EventArgs e)
        {
            string _ten = txtNhanVien.Text;
            int _mapb = int.Parse(drPhongBan.SelectedValue);

            LoadReport(_ten, _mapb);
        }

        protected void btnXemtatxa_Click(object sender, EventArgs e)
        {
            LoadReport("", 0);
        }
    }
}